package com.blog.cmrpersonalblog.dto.comment.responst;

import lombok.Data;

/**
 * 评论点赞响应DTO
 */
@Data
public class CommentLikeResponse {

    /**
     * 评论ID
     */
    private Long commentId;

    /**
     * 当前点赞状态
     */
    private Boolean isLiked;

    /**
     * 总点赞数
     */
    private Integer likeCount;

    /**
     * 操作消息
     */
    private String message;

    /**
     * 构造方法
     */
    public CommentLikeResponse() {}

    public CommentLikeResponse(Long commentId, Boolean isLiked, Integer likeCount, String message) {
        this.commentId = commentId;
        this.isLiked = isLiked;
        this.likeCount = likeCount;
        this.message = message;
    }

    /**
     * 创建点赞成功响应
     */
    public static CommentLikeResponse liked(Long commentId, Integer likeCount) {
        return new CommentLikeResponse(commentId, true, likeCount, "点赞成功");
    }

    /**
     * 创建取消点赞成功响应
     */
    public static CommentLikeResponse unliked(Long commentId, Integer likeCount) {
        return new CommentLikeResponse(commentId, false, likeCount, "取消点赞成功");
    }
}
